<!--#INCLUDE FILE="wyconn.asp"-->
<!-- #include file="aFun_CC_wyl.asp" -->

<BODY>
<%
call OlineUserList()
Call conn_Nothing()
%>
</BODY>

<%
sub OlineUserList()
     dim rs,onlinecount,onlinename
    set rs = server.CreateObject("adodb.recordset")
    rs.open "select * from ym_online order By onlinetime desc",conn,1,1          
          if Not rs.Eof then
                 onlinecount = rs.recordCount
                 dim configrs,useronlinecoun,useronlinecounttime
                 set configrs = server.CreateObject("adodb.recordset")
                 configrs.open "select * from option1 order By id desc",conn,1,1
                        if Not configrs.Eof then
                                useronlinecount = configrs("useronlinecount")
                                useronlinecounttime = configrs("useronlinecounttime")
                                if useronlinecount < onlinecount then
                                       Conn.ExeCute("update option1 set useronlinecount="& onlinecount &",useronlinecounttime='"& Now() &"'")
                                        useronlinecount = onlinecount
                                End if
                         End if
                 configrs.close
                 set configrs = Nothing
            End if
%>
            <CENTER>
                              <table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
                                    <tr><td colspan=6>
                                                 <a href="javascript:this.location.reload()"><img src="images/refresh.gif" alt="" border="0"></a>
                                                 <span style="FONT-SIZE: 9pt">
                                                 עû:</span>
                                     </tr>
                                     <tr>
<%
                                                   dim i
                                                   dim ha
                                                   dim hicount
                                                   ha=1
                                                   hicount=0
                                                   for i= 1 to rs.recordCount
                                                         onlinename=rs("onlinename")
                                                          if rs("onlinename")<>"ο" then
                                                                zcusernumber=zcusernumber+1
                                                          end if
                                                          if rs("onlinename")="ο" then
                                                                 onlinename=""
                                                          end if
                                                          if rs("hidename")=false then
                                                                  if onlinename<>"" then
                                                                          Response.Write "<td width=120 height=10>"
                                                                          call userStanding(onlinename)
                                                                           Response.Write "<span style='FONT-SIZE: 9pt'>"
                                                                           if session("tslt_username") = onlinename then
                                                                                   Response.Write "<font color=brown>" & onlinename & "</font>"
                                                                          else 
                                                                                    if MyFriend(onlinename) then
                                                                                             Response.Write "<font color=brown>" & onlinename & "</font>"
                                                                                    else
                                                                                             Response.Write  onlinename 
                                                                                    end if
                                                                           end if
                                                                           Response.Write "</td>"
                                                                           ha=ha+1
                                                                           if ha>6 then
                                                                                 ha=1
                                                                                 response.write"<tr>"
                                                                           end if
                                                                  end if
                                                          end if
                                                          if rs("hidename")=true then
                                                                 hicount=hicount+1
                                                          end if
                                                          rs.MoveNext
                                                          If rs.EOF Then Exit For
                                                   next
                                            Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_bottom_inc(0))</SCRIPT>"& onlinecount-zcusernumber &"<SCRIPT language=Javascript>passwords(promptInfo_bottom_inc(1))</SCRIPT>"
                                            if hicount<>0 then
                                                   Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_bottom_inc(2))</SCRIPT>"& hicount &"<SCRIPT language=Javascript>passwords(promptInfo_bottom_inc(3))</SCRIPT>"
                                            end if
%>
                                    </td></tr>
                             </table>
            </CENTER>
<%
      rs.close
      set rs = Nothing
end sub

function MyFriend(mfo)
          dim MyFrienOnline
          MyFrienOnline = false 
          if session("tslt_username")<>"" then
                 dim rs,self,self2
                 set rs=conn.execute("select friend from ts_userinfo where username='"&session("tslt_username")&"'")
                       do while not rs.eof
                             if RS("friend")<>"" then
                                    self = RS("friend")
                                    self2 = Split(self,"|")
                                    Dim i
                                    For i = UBound(self2) To 0 step-1
                                           if self2(i) = mfo then 
                                                 MyFrienOnline = true   
                                           end if                  
                                    Next
                             end if
                             rs.movenext
                       loop
                 rs.close
                 set rs=nothing
          end if
          MyFriend = MyFrienOnline
end function

sub userStanding(sss)
        dim rs,spl
         Set rs=server.createobject("ADODB.RECORDSET")
         sql="SELECT * FROM ts_userinfo where username='"&sss&"'"
         rs.open sql,conn,1,1
              if not rs.eof then
                   If rs("bclass")=1 Then
                       Response.Write "<img src='images/cjgly.gif' alt='Ա' width='16' height='16'>"			  
                   ElseIf rs("bclass")=2 Then
                       Response.Write "<img src='images/gly.gif' alt='Ա' width='16' height='16'>"
                   ElseIf rs("bclass")=3 Then
				       Response.Write "<img src='images/bz.gif' alt='' width='16' height='16'>"
                   ElseIf rs("aueUser")=True And rs("bclass")=0 Then
                       Response.Write "<img src='images/RZHY.gif' alt='֤Ա' width='16' height='16'>"
                   Else
                       Response.Write "<img src='images/ZCHY.gif' alt='עԱ' width='16' height='16'>"
                   End If 
			  end if
         rs.close
         set rs=nothing
end sub

%>

